import { exportUrl, getResult } from "@/api/fqc/mesFqcTaskDetail"
// 列表头按钮配置
export const operateList = [
  {
    name: $i18n.t("common.export"),
    type: "primary",
    icon: "el-icon-download",
    handleName: "export", //点击时返回的标识
    url: exportUrl
    //auth: "auth:operlog:export", //权限字段
  }
  // {
  //     name: "新增",
  //     type: "primary",
  //     icon: "el-icon-circle-plus-outline",
  //     handleName: 'add', // 点击时返回的标识
  //     // auth: "auth:user:add", //权限字段
  // },
  // {
  //     name: '删除',
  //     type: 'danger',
  //     icon: 'el-icon-delete',
  //     handleName: 'delete',
  //     isMultiple: true, // isSingle 表示必须选择一项//isMultiple: true, // 表示必须多选
  //     // auth: "auth:user:delete", //权限字段
  // }
]
// 行末按钮配置
export const rowConfig = [
  // {
  //   name: $i18n.t("common.view"),
  //   type: "primary",
  //   class: "row-btn-primary",
  //   handleName: "show" //点击时返回的标识
  // },
  // {
  //   name: $i18n.t("common.edit"),
  //   type: "primary",
  //   class: "row-btn-primary",
  //   handleName: "edit" //点击时返回的标识
  // }
]
// 搜索条件配置
export const searchConfig = {
  inline: true,
  formDesc: {
    resultCode: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.resultCode")
    },
    boxcode: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.boxCode")
    },
    prodName: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.modelName")
    }
  }
}
// 新增/删除表单配置
export const formDescDialog = {
  span: 24,
  disabled: true,
  isShowSubmitBtn: false,
  formDesc: {
    boxcode: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.boxCode"),
      layout: 12,
      required: true
    },
    prodCode: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.modelCode"),
      layout: 12,
      required: false,
      disabled: true
    },
    prodName: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.modelName"),
      layout: 12,
      required: false,
      disabled: true
    },
    seriesCode: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.seriesCode"),
      layout: 12,
      required: false,
      disabled: true
    },
    seriesName: {
      type: "input",
      label: $i18n.t("mesFqcTaskDetail.seriesName"),
      layout: 12,
      required: false,
      disabled: true
    },
    lineName: {
      type: "input",
      label: $i18n.t("common.lineName"),
      layout: 12,
      required: false,
      disabled: true
    },
    lineCode: {
      type: "input",
      label: $i18n.t("common.lineCode"),
      layout: 12,
      required: false,
      disabled: true
    },
    // count: {
    //     type: "number",
    //     label: "容量",
    //     layout:  12,
    //     required: false,
    // },
    startTime: {
      type: "datetime",
      label: $i18n.t("mesFqcTaskDetail.startTime"),
      layout: 12,
      required: false,
      attrs: {
        valueFormat: "yyyy-MM-dd HH:mm:ss"
      }
    },
    endTime: {
      type: "datetime",
      label: $i18n.t("mesFqcTaskDetail.endTime"),
      layout: 12,
      required: false,
      attrs: {
        valueFormat: "yyyy-MM-dd HH:mm:ss"
      }
    },
    result: {
      type: "select",
      label: $i18n.t("mesFqcTaskDetail.checkResult"),
      layout: 12,
      required: false,
      prop: {
        value: "value",
        text: "description",
      },
      options: async (data) => {
        const list = await getResult();
        return list.data.result;
      },

    },
    quantity: {
      type: "number",
      label: $i18n.t("mesFqcTaskDetail.checkAmount"),
      layout: 12,
      required: false,
    },
    remark: {
      type: "input",
      label: $i18n.t("common.remark"),
      layout: 12,
      required: false
    }
    // factoryCode: {
    //     type: "input",
    //     label: "工厂编码",
    //     layout:  12,
    //     required: false,
    // },
  }
}
